home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 65.zip
/
BS1 part 65
/
Math Visin v2.1 disk 1.adf
/
Arexx.WB
/
Simple
/
PolyGraph
< prev
next >
Wrap
Text File
|
1992-02-12
|
2KB
|
69 lines
/* PolyGraph make MathVision plot a series of graphs 31-Jan-90 dh
This program plots a series of Simple graphs, which are assumed to be
expressed one per line. For example, to plot "sin(x)", "x^2", and "x^3-3":
FA: sin(x)
FB: x^2
FC: x^3-3
For each non-empty function line, beginning with FA, this will plot
that function. This will stop at the first empty line, so leave an empty
line before your other stuff.
===========================================================================*/
ADDRESS "MathVision"
OPTIONS RESULTS
NUMERIC DIGITS 14
EditScreenToFront
LastFunction = 9
DO I = 1 TO LastFunction /* create array of function names */
Fun.I = "F"D2C(I+64) /* FA, FB, FC... */
END
MinimumY = 1e308 /* Find range of Y for all functions */
MaximumY = -1e308
StopSign "F"
DO I = 1 TO LastFunction
Get Fun.I
IF (RESULT ~= "RESULT") THEN /* this function exists? */
DO
F0 Fun.I'" Finding Minimum and Maximum'
GuessYminYmax
Get Ymin
MinimumY = Min( MinimumY, RESULT )
Get Ymax
MaximumY = Max( MaximumY, RESULT )
Get StopSign
IF (RESULT="T") THEN EXIT
END
ELSE BREAK
END
Ymin MinimumY /* set the cumulative min and max */
Ymax MaximumY
Overplot T /* now plot them all */
EraseScreen
PlotScreenToFront
SimplePen 1
DO I = 1 TO LastFunction
Get Fun.I
IF (RESULT ~= "RESULT") THEN /* this function exists? */
DO
F0 Fun.I
SimplePen I
PlotSimple
Get Fun.I
Expression = RESULT
Text 10" "I*10" "I" "Expression
Get StopSign
IF (RESULT="T") THEN EXIT
END
ELSE BREAK
END